package org.netspeak.android.utils;

import java.util.ArrayList;
import java.util.List;

import org.netspeak.application.generated.NetspeakMessages.Phrase;

/**
 * Helper class for all the little static things nobody else wants to do.
 * 
 * @author Teresa Holfeld, teresa.holfeld@gmail.com
 */
public class LittleHelper {

    /**
     * Creates and returns a new list of {@link ParcelablePhrase} objects that 
     * take the values of given {@link Phrase} objects.
     * 
     * @param phrases   list of Netspeak phrases
     * @return matching list of ParcelablePhrase
     */
    public static ArrayList<ParcelablePhrase> convertToParcelable(
            List<Phrase> phrases) {
        ArrayList<ParcelablePhrase> parcelablePhrases = 
                new ArrayList<ParcelablePhrase>();
        for (Phrase phrase : phrases) {
            parcelablePhrases.add(new ParcelablePhrase(phrase));
        }
        return parcelablePhrases;
    }
}
